package com.kma.summer2012.client.events.manager;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.kma.summer2012.shared.model.UICrumbsWorkItem;

public class EditWorkCategoryEvent extends GwtEvent<EditWorkCategoryEvent.EditWorkCategoryEventHandler> {
    private final UICrumbsWorkItem uiWork;


    public UICrumbsWorkItem getUiWork() {
        return this.uiWork;
    }


    public static GwtEvent.Type<EditWorkCategoryEventHandler> getType() {
        return TYPE;
    }
 /*
    public interface AddWorkEventHandler extends EventHandler {
        void OnAddWork(AddWorkEvent event, UICrumbsWorkItem uiWork);
    }
    */

    public interface EditWorkCategoryEventHandler extends EventHandler {
        void OnEditWorkCategory(EditWorkCategoryEvent event);
    }

    private static GwtEvent.Type<EditWorkCategoryEventHandler> TYPE = new GwtEvent.Type<EditWorkCategoryEventHandler>();


    public EditWorkCategoryEvent(UICrumbsWorkItem uiWork) {
        this.uiWork = uiWork;
    }

    @Override
    public GwtEvent.Type<EditWorkCategoryEventHandler> getAssociatedType() {
        return TYPE;
    }

    public GwtEvent.Type<EditWorkCategoryEventHandler> getTYPE() {
        return TYPE;
    }

    @Override
    protected void dispatch(EditWorkCategoryEventHandler addWorkEventHandler) {
        addWorkEventHandler.OnEditWorkCategory(this);
    }
}